Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавлен метод загрузки визитов веб-аналитики #184

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

Artem9-9
Copy link
Contributor

@Artem9-9 Artem9-9 commented Dec 6, 2023

No description provided.

@Artem9-9 Artem9-9 force-pushed the webanalitics-upload-visits branch 2 times, most recently from 3c252c2 to ccf6580 Compare December 8, 2023 11:48
/** @var VisitsUploadResponse $response */
$response = $this->sendRequest(
RequestMethod::POST,
'web-analytics/client-ids/upload',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Должно быть '/web-analytics/visits/upload'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему тогда к примеру в clientIdsUpload без этого слеша?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, слешь не нужно, копипаст сработал. А вот вместо client-ids должно быть visits.

EOF;

$entity = new Visit();
$entity->createdAt = '2023-12-06T12:00:00';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У нас формат Y-m-d H:i:s заложен. Если использовать текущий, нужно править логику апишки.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил, подогнал под нужный формат

{
"success": true
}
EOF;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут всё корректно?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вообще да, но поправил на более привычный вид
$json = '{"success": true}';

* @JMS\Type("string")
* @JMS\SerializedName("pageDepth")
*/
public $pageDepth;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У текущей и у $pageViews и $visitLength должны быть числовые типы.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У $pageDepth не исправлено.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

* $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey');
*
* $entity = new Visit();
* $entity->createdAt = '2023-12-06T12:00:00';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут также формат другой, у нас Y-m-d H:i:s.

->withBody($json);

$client = TestClientFactory::createClient($mock->getClient());
$response = $client->webAnalytics->visitsUpload($request);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ниже ворнинги нужно проверить.

* @JMS\Type("int")
* @JMS\SerializedName("pageViews")
*/
public $pageViews;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У нас мы меняли это название на countViews. В аннотации тоже нужно поменять.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

/**
* @var int
*
* @JMS\Type("int")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут тоже для единообразия integer можно.

* @JMS\Type("string")
* @JMS\SerializedName("pageDepth")
*/
public $pageDepth;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У $pageDepth не исправлено.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (454a5fa) 84.26% compared to head (2d0ed4c) 84.30%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #184      +/-   ##
============================================
+ Coverage     84.26%   84.30%   +0.04%     
- Complexity     1105     1108       +3     
============================================
  Files           168      169       +1     
  Lines          4194     4205      +11     
============================================
+ Hits           3534     3545      +11     
  Misses          660      660              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Neur0toxine Neur0toxine merged commit 7252092 into retailcrm:master Dec 20, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants